from time import sleep
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By

# 指定 Edge WebDriver 路径（根据你下载的路径修改）
webdriver_path = "H:\chromedriver64\msedgedriver.exe"

# 启动 Edge 浏览器
driver = webdriver.Edge(executable_path=webdriver_path)
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")

# 实例化
action = ActionChains(driver)

username2 = driver.find_element_by_css_selector("#userA")
username2.send_keys("admin")
# 暂停3秒钟后
sleep(3)
# 双击鼠标左键，选中admin
dc = action.double_click(username2)
dc.perform()


